home *** CD-ROM | disk | FTP | other *** search
/ Gekikoh Dennoh Club 2 / Gekikoh Dennoh Club Vol. 2 (Japan).7z / Gekikoh Dennoh Club Vol. 2 (Japan) (Track 01).bin / games / mashou / plugin / sepia.c < prev    next >
Text File  |  1997-05-29  |  756b  |  50 lines

  1. /*
  2.                                 
  3.             パレットセピア化
  4.             sepia.x
  5.     パレットを、一度に、セピア色に変更する。
  6.                                 
  7.                         by SJOM
  8.  
  9.  
  10. */
  11.  
  12. #include <sys/iocs.h>
  13.  
  14. /*
  15. #include <stdio.h>
  16. #include <stdlib.h>
  17. */
  18.  
  19.  
  20.  
  21. static void
  22. pal_sep(void)
  23. {
  24.     int block,code,col=0,bl=0,red=0,gr=0,Y=0;
  25.     for (block=2;block<16;block++) {
  26.     _iocs_spalet(0,block,-1);        /* dummy */
  27.         for (code=0;code<16;code++) {
  28.             gr=_iocs_spalet(code+0x80000000,block,-1);
  29.             bl=(gr>>=1) & 31;
  30.             red=(gr>>=5) & 31;
  31.             gr>>=5;
  32.             Y=(3*red+6*gr+bl)/10;
  33.             bl=Y/4;            /* Y*16/32; */
  34.             red=Y;            /* Y*32/32; */
  35.             gr=Y*21/32;        /* Y*26/32; */
  36.             col=(gr<<11) | (red<<6) | (bl<<1) | 1;
  37.             _iocs_spalet(code+0x80000000,block,col);
  38.         };
  39.     };
  40. }
  41.  
  42.  
  43. void
  44. main(void)
  45. {
  46.     pal_sep();
  47. }
  48.  
  49.  
  50.